/****************************************************
          File Name:8-5.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sat 20 Dec 2014 08:01:22 PM CST
*****************************************************/

#include<iostream>
using namespace std;

template<typename T> T max5(const T *a)
{
    T tmp = a[0];
    for(int i = 0; i < 5; i++)
    {
        if(tmp < a[i])
            tmp = a[i];
    }

    return tmp;
}

int main()
{
    int a[5] {1,2,3,41,0};
    double b[5] {0,3,99,309,1};

    cout << "Testing 'int'" << endl;
    cout << max5(a) << endl;
    cout << "Tesing 'double'" << endl;
    cout << max5(b) << endl;

    return 0;
}
